<div class="footer">
    <nav class="footer-bar">
        <div class="tab-item mui-active">
            <a href="{:url('home/index/index')}">
                <span class="mui-icon mui-icon-home"></span>
                <span class="mui-tab-label">首页</span>
            </a>
        </div>
        <div class="tab-item">
            <a href="{:url('home/search/search')}">
                <span class="mui-icon mui-icon-search"></span>
                <span class="mui-tab-label">搜索</span>
            </a>
        </div>
        <div class="tab-item">
            <a href="{:url('home/teacher/teacher_list')}">
                <span class="iconfont teacher">&#xe63a;</span>
                <span class="mui-tab-label">名师</span>
            </a>
        </div>
        <div class="tab-item">
            {if isset($_COOKIE['busid'])}
            <a href="{:url('home/business/center')}">
                <span class="mui-icon mui-icon-contact"></span>
                <span class="mui-tab-label">我的</span>
            </a>
            {else /}
            <a href="{:url('home/business/centernot')}">
                <span class="mui-icon mui-icon-contact"></span>
                <span class="mui-tab-label">我的</span>
            </a>
            {/if}
        </div>

    </nav>
</div>

<script>
    var urlstr = location.href; //获取点击的url
    var urlstatus = false;    //标识点击状态
    $(".tab-item a").each(function () {
        if ((urlstr + '/').indexOf($(this).attr('href')) > -1 && $(this).attr('href') != '') {
            $(this).parent(".tab-item").addClass('mui-active');   //添加点击状态类
            urlstatus = true;   //切换点击状态
        } else {
            $(this).parent(".tab-item").removeClass('mui-active');  //移除点击状态类
        }
    });

</script>